#include "widget.h"
#include "ui_widget.h"
#include <QTimer>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ret = new QTimer(this);
    connect(ret, &QTimer::timeout, this, &Widget::handle);
    ret->start(100);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handle()
{
    int value = ui->progressBar->value();
    if(value == 100)
        ret->stop();
    ui->progressBar->setValue(++value);
}

